/*
** main.c for main.c in /home/vermel/local/epitech/tek2/c/ftrace/pullup-project
** 
** Made by nathan vermelle
** Login   <vermel_n@epitech.net>
** 
** Started on  Fri Jun 29 14:07:22 2012 nathan vermelle
** Last update Sun Jul  1 17:39:19 2012 nathan vermelle
*/

#include "./../includes/ftrace.h"

void		usage()
{
   printf("./ftrace [-p pid] [progName]\n");
   exit(-1);
}

int	pars_input(int ac, char **av)
{
   if (ac < 2)
      usage();
   else if (ac == 3)
   {
      if (strcmp(av[1], "-p"))
	 usage();
      return (0);
   }
   return (1);
}

int	main(int ac, char *av[])
{
   (!pars_input(ac, av)) ?
      launch_ftracePid(atoi(av[2])) : launch_ftrace(av[1]);
   return 0;
}
